# -*- coding: utf-8 -*-
# @Time    : 2019/10/15 16:05
# @Author  : LiHaowen
# @Email   : lihaowen2017@163.com
# @File    : self_ex.py
# 自省是通过一定的机制查询到对象的内部结构
from advanced.chapter03.class_method import Date


class Person:
    """
    人
    """
    name = "user"


class Student(Person):
    def __init__(self, school_name):
        self.school_name = school_name


if __name__ == '__main__':
    user = Student("ABC")

    # 通过__dict__查询属性
    print(user.__dict__)
    user.__dict__["school_addr"] = "北京"
    print(user.school_addr)
    print(Person.__dict__)
    print(user.name)  # name通过MRO查询到的
    print(dir(user))  # 列出对象的所有属性
